package com.baosight.risk.web.xtzy;

import com.baosight.risk.api.xtzy.IXtzyIntegralService;
import com.baosight.risk.base.controller.BaseController;
import com.baosight.risk.common.result.AjaxResult;
import com.baosight.risk.service.xtzy.entity.XtzyIntegral;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.MediaType;

/**
 * @author CuiShiHao
 * @description 积分业务模块
 * @date 2019/9/11
 */
@Slf4j
@RestController
@RequestMapping("/xtzy/integral")

@Api(value = "积分业务", description = "积分业务", produces = MediaType.APPLICATION_JSON)
public class XtzyIntegralController extends BaseController {

    @Autowired
    private IXtzyIntegralService integralService;

    /**
     * 获取当前用户积分排名情况
     */
    @GetMapping("getUserIntegral")
    @ApiOperation("获取当前用户积分排名情况")
    public AjaxResult getUserIntegral(HttpServletRequest request) {
        XtzyIntegral integral = integralService.getUserIntegral();
        return success(integral);
    }
}
